import React, { Component } from 'react'
import App from './App'
import Admin from './admin'
// import Manage from './pages/manage'
// import Check from './pages/check';
import Login from './pages/login'
import Tables from './pages/table'
import City from './pages/city';
import Buttons from './pages/button';
import Order from './pages/order'
import User from './pages/user'
import BikeMap from './pages/map/bikeMap'
import Permission from './pages/permission'
import OrderDetail from './pages/order/detail'
import Home from './pages/Home'
import {HashRouter as Router, Route,Switch, Redirect} from 'react-router-dom'

export default class IRouter extends Component {
    render() {
        return (
           <Router>
               <App>
                   <Switch>
                        
                   <Route path='/login' component={Login} />
                  
                    <Route path="/common" exact render = {() => 
                             <Route path="/common/order/detail"  component={OrderDetail} />
                    
                    } /> 
                            
                    <Route path='/' render={() => 
                             <Admin>
                                 <Switch>
                                     <Route path='/home' component={Home} />
                                     
                                      <Route path='/ui/buttons' component={Buttons} />
                                      <Route path='/table/basic' component={Tables} />
                                      <Route path='/order' component={Order} />
                                      <Route path='/city' component={City} />
                                      <Route path="/user" component={User} />
                                      <Route path="/bikeMap" component={BikeMap} />
                                      <Route path="/permission" component={Permission} />
                                    {/* <Route path='/admin/guide/manage' component={Manage} />
                                    <Route path='/admin/guide/check' component={Check} /> */}
                                      <Redirect to="/login" />  
                               </Switch>
                            </Admin>
                    } />
                    
                   </Switch>
               </App>
           
           </Router>
        )
    }
}
